<template>
  <div class="app-container">
    <el-form class="formBox searchForm" :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
      label-position="left" label-width="60px">
      <el-form-item clearable label="医院" prop="hospital">
          <department ref="department" :isHospital="true" :isdepat="true" deptWidth="200px" @refreshData="refreshData">
          </department>
        </el-form-item>
      <el-form-item label="顾客ID" prop="patientId">
        <el-input v-model="queryParams.patientId" placeholder="顾客ID" clearable style="width: 160px"
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="顾客编号" prop="visitNum">
        <el-input v-model="queryParams.visitNum" placeholder="请输入顾客编号" clearable style="width: 160px"
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="姓名" prop="patientName">
        <el-input v-model="queryParams.patientName" placeholder="请输入顾客姓名" clearable style="width: 160px"
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="手机号" prop="patientPhone">
        <el-input v-model="queryParams.patientPhone" placeholder="请输入顾客手机号" clearable style="width: 160px"
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="身份证号" prop="idNum">
        <el-input v-model="queryParams.idNum" placeholder="顾客身份证号" clearable style="width: 185px" @focus="getSFZToSearch"
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <!-- <el-form-item label="操作人员" prop="createBy">
        <el-input v-model="queryParams.createBy" placeholder="请输入操作人员" clearable style="width: 160px"
          @keyup.enter.native="handleQuery" />
      </el-form-item> -->
      <el-form-item label="确费状态" prop="confirmExpense">
        <el-select v-model="queryParams.confirmExpense" filterable placeholder="请选择确费状态" clearable style="width: 160px">
          <el-option v-for="(item, index) in confirmExpenseList" :key="index" :label="item.label"
            :value="item.id"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="诊断日期">
        <el-date-picker v-model="dateRange" style="width: 240px" value-format="yyyy-MM-dd" type="daterange"  :picker-options="pickerOptions"
          range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" @change="handleQuery"></el-date-picker>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <div class="formBox searchForm" style="margin-bottom:0px!important;" ref="statisticalTable">
      <el-row :gutter="10" class="mb8">
        <!-- <el-col :span="1.5">
          <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
        </el-col> -->
        <!-- <el-col :span="1.5">
            <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single"
              @click="handleUpdate">修改</el-button>
          </el-col> -->
        <!--        <el-col :span="1.5">-->
        <!--          <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple"-->
        <!--            @click="handleDelete">删除</el-button>-->
        <!--        </el-col>-->

        <right-toolbar :showSearch.sync="showSearch" @queryTable="getlistsignList"></right-toolbar>
      </el-row>

      <el-table border v-loading="loading" style="width: 100%" :data="patientList"
        @selection-change="handleSelectionChange" :height="statisticalTableH" ref="table">
        <!-- <el-table-column type="selection" width="55" align="center" /> -->
        <el-table-column label="序号" align="center" type="index" width="50">
          <template slot-scope="scope">
            <span>{{ getIndex(scope.$index) }}</span>
          </template>
        </el-table-column>
        <el-table-column sortable label="顾客ID" align="center" prop="patientId" :show-overflow-tooltip="true"
          width="100" />
        <el-table-column sortable label="顾客编号" align="center" prop="visitNum" width="160">
          <template slot-scope="scope">
            <el-tooltip placement="right" effect="light">
              <div slot="content" v-html="renderTooltip(scope.row)" style="max-width: 700px" />
              <span style="text-decoration: underline;color: #10a1df; ">
                {{ scope.row.visitNum }}
              </span>
            </el-tooltip>
          </template>
        </el-table-column>
        <el-table-column sortable label="顾客姓名" align="center" prop="patientName" :show-overflow-tooltip="true"
          width="100" />
        <el-table-column sortable label="性别" align="center" prop="sex" width="80">
          <template slot-scope="scope">
            <dict-tag :options="dict.type.sys_user_sex" :value="scope.row.sex" />
          </template>
        </el-table-column>
        <el-table-column sortable label="年龄" align="center" prop="age" width="80" />
        <el-table-column sortable label="状态" align="center" prop="status" :show-overflow-tooltip="true" width="120">
<!--          <template slot-scope="scope">-->
<!--            <dict-tag :options="dict.type.sys_diagnosis_status" :value="scope.row.status" />-->
<!--          </template>-->
          <template slot-scope="scope">
            <el-tag v-if="scope.row.status=='0'" type="danger" size="mini">
              <dict-tag
                :options="dict.type.sys_diagnosis_status"
                :value="scope.row.status"
              />
            </el-tag>
            <el-tag v-else-if="scope.row.status=='1'" type="warning" size="mini">
              <dict-tag
                :options="dict.type.sys_diagnosis_status"
                :value="scope.row.status"
              />
            </el-tag>
            <el-tag v-else-if="scope.row.status=='3'" type="success" size="mini">
              <dict-tag
                :options="dict.type.sys_diagnosis_status"
                :value="scope.row.status"
              />
            </el-tag>
            <el-tag v-else-if="scope.row.status=='4'" size="mini">
              <dict-tag
                :options="dict.type.sys_diagnosis_status"
                :value="scope.row.status"
              />
            </el-tag>
          </template>
        </el-table-column>
        <el-table-column sortable label="登记日期" align="center" prop="createTime" width="160">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.createTime) }}</span>
          </template>
        </el-table-column>
        <el-table-column sortable label="确费状态" align="center" prop="confirmExpense" :show-overflow-tooltip="true"
          width="100">
          <template slot-scope="scope">
            <el-tag size="mini" :type="scope.row.confirmExpense == '0' ? 'danger' : 'primary'">
              <span>{{ scope.row.confirmExpense == '1' ? '已确费' : '未确费' }}</span>
            </el-tag>
          </template>
        </el-table-column>
        <!-- <el-table-column sortable label="通用问卷" align="center" prop="questionnaireStatus" width="100px">
          <template slot-scope="scope">
            <el-tag :type="scope.row.questionnaireStatus == '1' ? 'danger' : 'primary'">
              <dict-tag :options="dict.type.sys_general_questionnaire" :value="scope.row.questionnaireStatus" />
            </el-tag>
          </template>
        </el-table-column>
        <el-table-column sortable label="专病问卷" align="center" prop="diseaseQuestionnaireStatus" width="100px">
          <template slot-scope="scope">
            <el-tag :type="scope.row.diseaseQuestionnaireStatus == '0' ? 'danger' : 'primary'">
              {{ scope.row.diseaseQuestionnaireStatus == '0' ? '未填写' : scope.row.diseaseQuestionnaireStatus }}
            </el-tag>
          </template>
        </el-table-column>
        <el-table-column sortable label="照片" align="center" prop="photoCount">
          <template slot-scope="scope">
            <el-tag :type="parseInt(scope.row.photoCount) > 0 ? 'primary' : 'danger'">{{ scope.row.photoCount }}</el-tag>
          </template>
        </el-table-column> -->
        <!-- <el-table-column sortable label="咨询诊断" align="left" prop="consultationDiagnosisValue" width="220">
          <template slot-scope="scope">
            <span v-html="scope.row.consultationDiagnosisValue"></span>
          </template>
        </el-table-column>
        <el-table-column sortable label="咨询方案" align="left" prop="consultationPlan" width="220">
          <template slot-scope="scope">
            <el-tooltip placement="top" effect="light">
              <div slot="content" v-html="scope.row.consultationPlan" style="max-width: 700px;font-size:18px;"></div>
              <div v-html="scope.row.consultationPlan"
                style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"></div>
            </el-tooltip>
          </template>
        </el-table-column>
        <el-table-column sortable label="咨询医生" align="center" prop="consultationer" width="100" />
        <el-table-column sortable label="咨询日期" align="center" prop="consultationTime" width="180">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.consultationTime) }}</span>
          </template>
        </el-table-column> -->
        <el-table-column sortable label="医生诊断" align="left" prop="doctorDiagnosis" width="220">
          <template slot-scope="scope">
            <span v-html="scope.row.doctorDiagnosis"></span>
          </template>
        </el-table-column>
        <el-table-column label="医生方案" align="left" prop="doctorPlan" width="220">
          <template slot-scope="scope">
            <el-tooltip placement="top" effect="light">
              <div slot="content" v-html="scope.row.doctorPlan" style="max-width: 700px;font-size:18px;"></div>
              <div v-html="scope.row.doctorPlan" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
              </div>
            </el-tooltip>
          </template>
        </el-table-column>
        <el-table-column sortable label="诊断医生" align="center" prop="doctor" width="100" />
        <el-table-column sortable label="诊断日期" align="center" prop="doctorTime" width="180">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.doctorTime) }}</span>
          </template>
        </el-table-column>
        <el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width" width="100">
          <template slot-scope="scope">
            <el-button size="mini" type="text" @click="handleAdd(scope.row)"
              v-if="scope.row.confirmExpense != '1'">确费</el-button>
            <el-button size="mini" type="text" @click="handleAdd(scope.row)">签到</el-button>
          </template>
        </el-table-column>
      </el-table>
      <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
        @pagination="getlistsignList" />
    </div>

    <!-- 添加或修改顾客信息对话框 -->
    <el-dialog :title="recordTitle" :visible.sync="recordVisible" width="90%" append-to-body :close-on-click-modal="false"
      :before-close="closerecordVisible"  v-dialogDrag>
      <confirmAttend v-if="recordVisible" @closerecordVisible="closerecordVisible" :clickVisitNum="visitNum">
      </confirmAttend>
    </el-dialog>



  </div>
</template>

<script>
import department from "@/views/components/department/index.vue";
import { getList } from "@/api/doctorWorkstation/diagnosisList";
import { startReadCard } from "@/utils/getIdCard"
import {
  deleteTreatment,
  getTreatmentList,
} from "@/api/treatmentWorkstation/treatmentManagement";
import {
  updatesign,
  listsignList,
  getsign,
  delsign
} from "@/api/comfirmAttend/comfirmAttend";
import confirmAttend from "@/views/components/confirmAttend/confirmAttend"
// 导入的方法将使用文件系统
// 访问API或回退实现。
export default {
  name: "TreatmentManagement",
  dicts: [
    "sys_diagnosis_status",
    "sys_user_sex",
    "sys_patient_properties",
    "sys_skin_tone",
    "sys_patient_sort",
    "sys_outpatient_clinic",
    "sys_general_questionnaire",
    "sys_patient_reason",
    "sys_face_part",
    "sys_treatment_reaction",
    "sys_treatment_effect",

  ],
  components: { confirmAttend, department},

  data() {
    return {
      pickerOptions: {
                disabledDate(time) {
                    return time.getTime() > Date.now() - 8.64e6;  //如果没有后面的-8.64e6就是不可以选择今天的
                },
                shortcuts: [{
                    text: '今天',
                    onClick(picker) {
                        const end = new Date();
                        const start = new Date();
                        picker.$emit('pick', [start, end]);
                    }
                }, {
                    text: '昨天',
                    onClick(picker) {
                        const date = new Date();
                        date.setTime(date.getTime() - 3600 * 1000 * 24);
                        const end = date;
                        const start = date;
                        picker.$emit('pick', [start, end]);
                    }
                }, {
                    text: '前天',
                    onClick(picker) {
                        const date = new Date();
                        date.setTime(date.getTime() - 3600 * 1000 * 24 * 2);
                        const end = date;
                        const start = date;
                        picker.$emit('pick', [start, end]);
                    }
                }, {
                    text: '最近一周',
                    onClick(picker) {
                        const end = new Date();
                        const start = new Date();
                        start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
                        picker.$emit('pick', [start, end]);
                    }
                }, {
                    text: '最近一个月',
                    onClick(picker) {
                        const end = new Date();
                        const start = new Date();
                        start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
                        picker.$emit('pick', [start, end]);
                    }
                }, {
                    text: '最近三个月',
                    onClick(picker) {
                        const end = new Date();
                        const start = new Date();
                        start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
                        picker.$emit('pick', [start, end]);
                    }
                }, {
                    text: '最近六个月',
                    onClick(picker) {
                        const end = new Date();
                        const start = new Date();
                        start.setTime(start.getTime() - 3600 * 1000 * 24 * 180);
                        picker.$emit('pick', [start, end]);
                    }
                }, {
                    text: '最近1年',
                    onClick(picker) {
                        const end = new Date();
                        const start = new Date();
                        start.setTime(start.getTime() - 3600 * 1000 * 24 * 365);
                        picker.$emit('pick', [start, end]);
                    }
                }]
            },
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      patientNames: [],
      patientVisitNum: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 治疗列表
      patientList: [],
      // 查询参数
      queryParams: {
        deptId: undefined, // deptId: 0,
        hospitalId: undefined,
        pageNum: 1,
        pageSize: 10,
        visitNum: undefined,
        patientName: undefined,
        createBy: undefined,
        idNum: undefined,
        patientId: undefined,
        status: 3,
        confirmExpense: undefined,
      },
      // 日期范围
      dateRange: [],
      // 新增信息-------
      submitStatus: true,
      recordVisible: false,
      // 新增标题
      recordTitle: '',
      // 搜索总条数
      searchTotal: 0,
      // 新增顾客时单项
      patientItem: {},
      uploadPackageContent: '',
      detailTitle: "",
      detailDialogVisible: false,
      baseInfo: {},
      confirmExpenseList: [{ label: '未确费', id: 0 }, { label: '已确费', id: 1 }],
      visitNum: null,
      statisticalTableH: undefined,
    };
  },
  watch: {
    showSearch() {
            this.$nextTick(() => {
                this.changeHeight()
            }, 1000)
        }
  },
  computed: {

    defaultTime: function () {
      let date = new Date();
      let year = date.getFullYear();
      let month = date.getMonth() + 1;
      let day = date.getDate();
      month = month > 9 ? month : "0" + month;
      day = day < 10 ? "0" + day : day;
      let today = year + "-" + month + "-" + day;
      return [today, today];
    },
  },

  created() {
    this.dateRange = this.defaultTime
    

  },
  updated() {
        this.$nextTick(() => {
            this.$refs.table.doLayout()
        })
    },
    mounted() {
        this.changeHeight()
    },
  methods: {
    changeHeight() {
            if (this.$refs.statisticalTable) {
                const statisticalTableObj = this.$refs.statisticalTable.getBoundingClientRect();
                let h = statisticalTableObj.top + 100
                this.statisticalTableH = 'calc(100vh - ' + h + 'px)'
            } else {
                this.statisticalTableH = '500px'
            }
        },
    refreshData(data) {
      this.queryParams.pageNum = 1;
      this.queryParams.hospitalId = data.hospitalId;
      this.queryParams.deptId = data.deptId;
      this.queryParams.beginTime = this.dateRange[0]
    this.queryParams.endTime = this.dateRange[1]
    this.getlistsignList()
    },
    renderTooltip(row) {
      return `<div style="margin-bottom:5px;font-size:20px;color:#1890ff;"><span style="font-weight:bold;"> 顾客状态：</span>${this.matchDict("sys_diagnosis_status", row.status)}</div>
        <div style="width: 100%;height:1px;background-color: red;margin-bottom:5px;"></div>
        <div style="margin-bottom:5px;font-size:18px"><span style="margin-right:10px;"><span style="font-weight:bold;">登记日期：</span>${this.parseTime(row.createTime)}</span><span style="margin-right:10px;"><span style="font-weight:bold;">登记人：</span>${this.formatValue(row.createBy)}</span><span style="margin-right:10px;"><span style="font-weight:bold;">就诊科室：</span>${this.formatValue(row.deptName)}</span> </div>
        <div style="margin-bottom:5px;font-size:18px"><span style="margin-right:10px;"><span style="font-weight:bold;">顾客性质：</span>${this.matchDict("sys_patient_properties", row.properties)}</span><span style="margin-right:10px;"><span style="font-weight:bold;">顾客分类：</span>${this.matchDict("sys_patient_sort", row.customerSort)}</span></div>
        <div style="margin-bottom:5px;font-size:18px"><span style="font-weight:bold;">地址：</span>${this.formatValue(row.address)}</div>
        <div style="margin-bottom:5px;font-size:18px"><span style="font-weight:bold;">电话：</span>${this.formatValue(row.patientPhone)}</div>
        <div style="width: 100%;height:1px;background-color: red;margin-bottom:5px;"></div>
        <div style="margin-bottom:5px;font-size:18px"><span style="margin-right:10px;"><span style="font-weight:bold;">通用问卷：</span>${this.matchDict("sys_general_questionnaire", row.questionnaireStatus)}</span><span style="margin-right:10px;"><span style="font-weight:bold;">专病问卷：</span>${this.formatValue(row.diseaseQuestionnaireStatus)}</span><span style="margin-right:10px;"><span style="font-weight:bold;">照片：</span>${this.formatValue(row.photoCount)}</span></div>
        <div style="margin-bottom:5px;font-size:18px"><span style="margin-right:10px;"><span style="font-weight:bold;">咨询日期：</span>${this.formatValue(row.consultationTime)}</span><span style="margin-right:10px;"><span style="font-weight:bold;">咨询医生：</span>${this.formatValue(row.consultationer)}</span></div>
        <div style="margin-bottom:5px;font-size:18px"><span style="font-weight:bold;">咨询诊断：</span>${this.formatValue(row.consultationDiagnosis)}</div>
        <div style="margin-bottom:5px;font-size:18px"><span style="font-weight:bold;">咨询方案：</span>${this.formatValue(row.consultationPlan)}</div>
        <div style="margin-bottom:5px;font-size:18px"><span style="margin-right:10px;"><span style="font-weight:bold;">方案总额：</span>${this.formatValue(row.consultationTotalExpenses)}</span><span style="margin-right:10px;"><span style="font-weight:bold;">治疗费用：</span>${this.formatValue(row.consultationTreatmentExpenses)}</span></div>
        <div style="width: 100%;height:1px;background-color: red;margin-bottom:5px;"></div>
        <div style="margin-bottom:5px;font-size:18px"><span style="margin-right:10px;"><span style="font-weight:bold;">诊断日期：</span>${this.formatValue(row.doctorTime)}</span><span style="margin-right:10px;"><span style="font-weight:bold;">诊断医生：</span>${this.formatValue(row.doctor)}</span></div>
        <div style="margin-bottom:5px;font-size:18px"><span style="font-weight:bold;">医生诊断：</span>${this.formatValue(row.doctorDiagnosis)}</div>
        <div style="margin-bottom:5px;font-size:18px"><span style="font-weight:bold;">医生方案：</span>${this.formatValue(row.doctorPlan)}</div>
        <div style="margin-bottom:5px;font-size:18px"><span style="margin-right:10px;"><span style="font-weight:bold;">方案总额：</span>${this.formatValue(row.doctorTotalExpenses)}</span><span style="margin-right:10px;"><span style="font-weight:bold;">治疗费用：</span>${this.formatValue(row.doctorTreatmentExpenses)}</span><span style="margin-right:10px;"><span style="font-weight:bold;">复诊次数：</span>${this.formatValue(row.reviewNum)}</span></div>
        <div style="width: 100%;height: 1px;background-color: red;margin-bottom:5px;"></div>
        <div style="margin-bottom:5px;font-size:18px"><span style="margin-right:10px;"><span style="font-weight:bold;">知情同意书：</span>${this.formatValue(row.informedConsent)}</span><span style="margin-right:10px;"><span style="font-weight:bold;">确费状态：</span>${this.formatValue(row.confirmExpense == '1' ? '已确费' : '未确费')}</span><span style="margin-right:10px;"><span style="font-weight:bold;">治疗次数：</span>${this.formatValue(row.treatmentTimes)}</span><span style="margin-right:10px;"><span style="font-weight:bold;">温馨提示：</span>${this.formatValue(row.tipsTimes)}</span></div>`
    },
    /** id转化成对应的文字 */
    matchDict: function (key, id) {
      let _this = this;
      const result = _this.dict.type[key];
      let textValue = "";
      result.forEach((item) => {
        if (item.raw.dictValue == id) {
          textValue = item.raw.dictLabel;
        }
      });
      return textValue;
    },
    closerecordVisible() {
      this.handleQuery()
      this.closeRecord()
    },
    formatValue(value) {
      if (value == null) {
        return ''
      } else {
        return value
      }
    },
    async getSFZToSearch() {
      const res = await startReadCard()
      if (res.result == 3) {
        this.$message.warning('请把身份证放到读卡器上')
        // this.$refs.saveTagInput.blur();
      } else if (res.result == 2) {
        // this.$message.warning('设备不存在')
      } else {
        this.queryParams.idNum = res.gmsfhm
      }

    },
    // 真实序号计算（计算分页影响）
    getIndex(index) {
      return (this.queryParams.pageNum - 1) * this.queryParams.pageSize + index + 1;
    },
    closeRecord() {
      this.recordVisible = false
    },
    goDetail(row) {
      // this.$router.push("/patientRegistration/patientRegistration-detail/index/" + row.patientId);
      this.detailTitle = '顾客详情'
      this.baseInfo = row
      this.detailDialogVisible = true
    },
    // 获取顾客诊断列表
    getlistsignList() {
      this.loading = true
      if(this.queryParams.visitNum||this.queryParams.patientId){
        this.dateRange=[]
        this.queryParams.beginTime=''
        this.queryParams.endTime=''
      }
      getList(this.queryParams).then(
        (response) => {
          if (response.code == 200) {
            this.patientList = response.rows;
            this.total = response.total;
            this.loading = false;
          }
        })

      // listsignList(this.addDateRange(this.queryParams, this.dateRange)).then(
      //   (response) => {
      //     if (response.recognizeCode == 200) {
      //       this.patientList = response.rows;
      //       this.total = response.total;
      //       this.loading = false;
      //     } else {
      //       this.loading = false;
      //       this.$modal.msgError(response.msg);
      //     }
      //   }
      // )
    },

    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      if(this.dateRange!=null){
        this.queryParams.beginTime = this.dateRange[0]
        this.queryParams.endTime = this.dateRange[1]
      }else {
        this.queryParams.beginTime=''
        this.queryParams.endTime=''
      }
      this.getlistsignList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.dateRange = [];
      this.resetForm("queryForm");
      this.handleQuery();
    },

    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map((item) => item.id);
      this.patientNames = selection.map((item) => item.patientName);
      this.patientVisitNum = selection.map((item) => item.visitNum);
      // console.log('handleSelectionChange---', this.ids)
      // console.log('handleSelectionChange---', this.patientVisitNum)

      this.single = selection.length != 1;
      this.multiple = selection.length != 1;
      // this.multiple = !selection.length;
    },
    /** 新增按钮操作 */
    handleAdd(row) {
      this.recordTitle = '新增确费签到'
      this.submitStatus = true
      this.recordVisible = true
      this.visitNum = row.visitNum

    },
    handleDelete() {
      const patientNames = this.patientNames;
      const id = this.ids;

      this.$confirm(` 是否确认删除顾客姓名为 <strong>(${patientNames})</strong>) 的记录?`, '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
        dangerouslyUseHTMLString: true,
      })
        .then((content) => {
          deleteTreatment(id).then(
            (response) => {
              if (response.code == 200) {
                // console.log('deleteTreatment',response)
                this.getlistsignList()
              } else {
                this.$modal.msgError(response.msg);
              }

            }
          )
          // console.log('content', content)
        })
        .catch((error) => {
          // console.log('error', error)
        })


    },
  },
};
</script>
<style scoped rel="stylesheet/scss"  lang="scss">
::v-deep .el-form-item.is-required:not(.is-no-asterisk)>.el-form-item__label:before,
.el-form-item.is-required:not(.is-no-asterisk) .el-form-item__label-wrap>.el-form-item__label:before {
  display: inline-block;
  content: '*';
  color: red;
  margin-left: 4px;
}

::v-deep .el-form-item.is-required:not(.is-no-asterisk)>.el-form-item__label::after,
.el-form-item.is-required:not(.is-no-asterisk) .el-form-item__label-wrap>.el-form-item__label::after {
  display: none;
}

::v-deep .el-input.is-disabled .el-input__inner {
  color: #606266;
}

.uploadBtnBox {
  display: flex;

  .btn {
    margin-left: 10px;
  }
}

.positionSchemeBox {
  display: flex;
  justify-content: space-between;
}

.uploadImageBox {
  //width: 500px;
  min-height: 500px;
  border: 1px solid #f3a4a1;
  margin: 10px auto;
}

.formBtn {
  margin: 0 auto;
  display: block;
}

.img-style {
  width: 500px;
  height: 500px;

  ::v-deep .el-image__error {
    opacity: 0;
  }
}

::v-deep .el-input.is-disabled .el-input__inner {
  color: #606266;
}

::v-deep .inputRed.el-input.is-disabled .el-input__inner {
  color: red;
}

::v-deep .el-textarea.is-disabled .el-textarea__inner {
  color: #606266;
}


.treatmentParametersListBox {
  display: flex;
  //flex-wrap: wrap;
  justify-content: center;

  .smallBox {
    margin-right: 10px;
    //margin-bottom: 10px;
    font-size: 18px;

    .numBox {
      font-weight: bold;
      color: red;
      font-size: 20px;
    }
  }


}

.treatmentParametersListBoxBtn {
  display: flex;
  align-items: center;

  //max-width: 990px;
  //border: 1px solid #C0C4CC;
  .el-form-item {
    margin-top: 10px;
  }

}

::v-deep .el-dialog {
  margin-top: 0 !important;
}

.draggable-item {
  display: inline-block;
  margin: 0 8px 8px 0;
  font-size: 0;
  line-height: 0;
  vertical-align: middle;
  position: relative;
}

.upload-img {
  display: inline-block;
  margin: 0 8px 8px 0;
  font-size: 0;
  line-height: 0;
  overflow: hidden;
  vertical-align: middle;
}

.icon-close {
  position: absolute;
  right: 0;
  top: 0;
  font-size: 18px;
  color: #00be8b;
  z-index: 1;
}
</style>
